package main

import "fmt"

func main() {

	var v1 interface{} = new(MyFile)
	switch v := v1.(type) {
	case MyWriter:
		fmt.Println("MyWriter  ", v)
	case int:
		fmt.Println("int  ", v)
	}
}

type MyWriter interface {
	Write(buf []byte) (n int, err error)
}

type MyFile struct {
}

func (receiver MyFile) Write(buf []byte) (n int, err error) {
	return n, nil
}
